<!-- 个人页面顶部组件 -->
<template>
  <div class="personal-info">
    <div class="personal-info-name">
      <div class="nickname">
        <p>热心市民李先生</p>
        <div class="level">
          <span class="star"><img src="@/images/star.png" alt=""></span>
          <span class="level-text">16</span>
        </div>
      </div>
      <div class="identify">ID: 1069643013</div>
      <img src="@/images/avatar.jpg" class="avatar">
      <img src="@/images/editor.png" alt="" class="editor">
    </div>
    <div class="personal-info-number">
      <div class="number-item" v-for="item in infoList" :key="item.name">
        <div class="number-item-title">{{ item.name }}</div>
        <div class="number-item-content">{{ item.number }}</div>
      </div>
    </div>
  </div>
</template>

<script>
//composition
export default {
  name: 'information',
  setup() {
    const infoList = [
      { name: '红包', number: 218 },
      { name: '优惠券', number: '12张' },
      { name: '鲜豆', number: 88 },
      { name: '白条', number: 1000 },
    ]
    return { infoList }
  }
}
</script>

<style scoped lang="scss">
@import '@/styles/theme.scss';

.personal-info {
  height: 54.1333vw;
  width: 90.4vw;
  position: absolute;
  left: 50%;
  margin-left: -45.2vw;
  bottom: -16.2667vw;
  background-color: $white;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;

  &-name {
    height: 33.8667vw;
    border-bottom: 1px solid #F1F1F1;
    padding-top: 15.7333vw;
    text-align: center;
    position: relative;

    .nickname {
      margin-bottom: 2.6667vw;
      position: relative;

      p {
        font-size: 24px;
        color: #262628;
      }

      .level {
        width: 70px;
        height: 30px;
        position: absolute;
        background-image: linear-gradient(180deg, #BEE700 0%, #8ACA00 100%);
        border-radius: 15px;
        top: -2px;
        left: 50%;
        margin-left: 80px;
        transform: scale(.5);
        display: flex;
        align-items: center;

        .star {
          width: 22px;
          height: 22px;
          border-radius: 50%;
          margin-left: 5px;
          background-color: rgba(0, 0, 0, 0.20);

          img {
            width: 80%;
            margin: 0 auto;
          }
        }

        &-text {
          flex: auto;
          padding-right: 8px;
          font-size: 20px;
          color: $white;
        }
      }
    }

    .identify {
      font-size: 14px;
      color: #C1C0C9;
    }

    .avatar {
      width: 25.0667vw;
      height: 25.0667vw;
      position: absolute;
      top: -12.5333vw;
      left: 50%;
      margin-left: -12.5333vw;
      border-radius: 12.5333vw;
      box-shadow: 0 1px 10px 5px rgba(0, 0, 0, 0.08);
    }

    .editor {
      width: 24px;
      position: absolute;
      top: -15vw;
      right: 5px;

    }
  }

  &-number {
    flex: auto;
    display: flex;

    .number-item {
      flex: auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      &-title {
        font-size: 12px;
        color: #C1C0C9;
        margin-bottom: 3px;
      }

      &-content {
        font-size: 20px;
        color: #262628;
      }
    }
  }
}</style>